<!DOCTYPE html>
<html><head>
	    <meta charset="utf-8">
    <title>111111111111111111111</title>

    <meta name="description" content="Dashboard">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--Basic Styles-->
    <link href="__PUBLIC__/style/bootstrap.css" rel="stylesheet">
    <link href="__PUBLIC__/style/font-awesome.css" rel="stylesheet">
    <link href="__PUBLIC__/style/weather-icons.css" rel="stylesheet">

    <!--Beyond styles-->
    <link id="beyond-link" href="__PUBLIC__/style/beyond.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/style/demo.css" rel="stylesheet">
    <link href="__PUBLIC__/style/typicons.css" rel="stylesheet">
    <link href="__PUBLIC__/style/animate.css" rel="stylesheet">
    
</head>
<body>
	<!-- 头部 -->
	<include file ="Common/header"/>
	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			            <!-- Page Sidebar -->
            <include file="Common/left"/>
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                                        <li>
                        <a href="__URL__/lst">商品管理</a>
                    </li>
                                        <li class="active">商品库存</li>
                                        </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-body">
                <div class="flip-scroll">
				<form action="" method="post">
							<table class="table table-bordered table-hover">
								<thead class="">
									<tr>
										<volist name="radioAttr" id="vo">
												<th align="left"  >{$vo[0]['attr_name']}</th>
										</volist>
												<th align="left"  >库存量</th>
										<th class="text-center" width = "20%">操作</th>
									</tr>
								</thead>
								<tbody>
								<if condition="$prores">
										<foreach name="prores" item="vo0" key="k0" >
												<tr>
														<foreach name="radioAttr" item="vo" key="k" >
																	<td align="left">
																		<select name="goods_attr[{$k}][]">
																				<option value="">请选择</option>
																				
																					<?php  foreach($vo as $k2=>$v2):
																						if(strpos(','.$vo0['goods_attr'].',',','.$v2['id'].',')!==false){
																								$select='selected="selected"';
																						}else{
																								$select="";
																						}
																					?>
																							<option <?php  echo $select; ?>value="<?php echo $v2['id']; ?>"><?php echo $v2['attr_value']; ?></option>
																					<?php endforeach; ?>
																				
																			</select>
																	</td>
															</foreach>
															<td align="left"><input type="text" name="goods_num[]" value="{$vo0.goods_number}"/></td>
															<td align="center" >
																	<input type="button" class="btn btn-danger btn-sm shiny" value="<if condition="$k0 eq 0">+<else/>-</if>" onclick="addrow(this);">
															</td>		
													</tr>
											</foreach>
									<else/>
													<tr>
															<foreach name="radioAttr" item="vo" key="k" >
																		<td align="left">
																			<select name="goods_attr[{$k}][]">
																					<option value="">请选择</option>
																					<volist name="vo" id="vo2">
																						<option value="{$vo2.id}">{$vo2.attr_value}</option>
																					</volist>
																				</select>
																		</td>
															</foreach>
															<td align="left"><input type="text" name="goods_num[]" /></td>
															<td align="center" >
																		<input type="button" class="btn btn-danger btn-sm shiny" value="+" onclick="addrow(this);">
															</td>		
													</tr>
									</if>
								</tbody>
							</table>
							<input type="submit" class="btn btn-darkorange btn-block" value="添加库存"  style="width:150px;margin:10px">
					</form>
                </div>
            </div>
        </div>
    </div>
</div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

	    <!--Basic Scripts-->
    <script src="__PUBLIC__/style/jquery_002.js"></script>
    <script src="__PUBLIC__/style/bootstrap.js"></script>
    <script src="__PUBLIC__/style/jquery.js"></script>
    <!--Beyond Scripts-->
    <script src="__PUBLIC__/style/beyond.js"></script>
    <script type="text/javascript">
			function addrow(o){
				var tr=$(o).parent().parent();
				if($(o).val()=="+"){
					var newtr=tr.clone();
					newtr.find(":button").val("-");
					tr.after(newtr);
				}else{
					tr.remove();
				}
			}
	</script>


</body></html>